package com.kahriboo.log4mon.client;

import com.google.gwt.junit.client.GWTTestCase;

/**
 * GWT JUnit <b>integration</b> tests must extend GWTTestCase. Using
 * <code>"GwtTest*"</code> naming pattern exclude them from running with
 * surefire during the test phase.
 */
public class NotGwtTestlog4mon extends GWTTestCase {

	/**
	 * Must refer to a valid module that sources this class.
	 */
	@Override
	public String getModuleName() {
		return "com.kahriboo.log4mon.log4monJUnit";
	}

	/**
	 * This test will send a request to the server using the greetServer method
	 * in GreetingService and verify the response.
	 */
	// public void testGreetingService() {
	// // Create the service that we will test.
	// final LogEventServiceAsync greetingService =
	// GWT.create(LogEventService.class);
	// final ServiceDefTarget target = (ServiceDefTarget) greetingService;
	// target.setServiceEntryPoint(GWT.getModuleBaseURL() + "log4mon/greet");
	//
	// // Since RPC calls are asynchronous, we will need to wait for a response
	// // after this test method returns. This line tells the test runner to
	// // wait
	// // up to 10 seconds before timing out.
	// delayTestFinish(10000);
	//
	// // Send a request to the server.
	// greetingService.getEventCount(new AsyncCallback<Integer>() {
	// public void onFailure(final Throwable caught) {
	// // The request resulted in an unexpected error.
	// fail("Request failure: " + caught.getMessage());
	// }
	//
	// public void onSuccess(final Integer result) {
	// // Verify that the response is correct.
	// // assertTrue(result.startsWith("Hello, GWT User!"));
	//
	// // Now that we have received a response, we need to tell the
	// // test runner
	// // that the test is complete. You must call finishTest() after
	// // an
	// // asynchronous test finishes successfully, or the test will
	// // time out.
	// finishTest();
	// }
	// });
	// }

}
